package com.chushouya.order.dto.api.clerk;

import com.general.framework.core.lang.Dates;
import com.chushouya.order.constants.LogisticsStatusEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@Data
@ApiModel("业务员操作超时订单")
public class ClerkOvertimeOrderDTO {

    @ApiModelProperty("订单ID")
    private Long orderId;

    @ApiModelProperty("订单号")
    private String orderNo;

    @ApiModelProperty("商品条码")
    private String productBarCode;

    @ApiModelProperty("下单型号名称")
    private String productName;

    @ApiModelProperty("用户名")
    private String userName;

    @ApiModelProperty("客服")
    private String kefuName;

    @ApiModelProperty("用户手机号")
    private String userPhone;

    @ApiModelProperty("成交价")
    private BigDecimal completePrice;

    @ApiModelProperty("下单时间")
    private Date createTime;

    @ApiModelProperty("上门时间")
    private Date visitTime;

    @ApiModelProperty("完成时间")
    private Date completeTime;

    @ApiModelProperty("完成距今天数")
    private Integer completeDays;

    @ApiModelProperty("发货状态")
    private Integer logisticsStatus;

    @ApiModelProperty("入库状态")
    private Integer stockStatus;

    @ApiModelProperty("发货状态")
    private String logisticsStatusText;

//    @ApiModelProperty("入库状态")
//    private String stockStatusText;

    @ApiModelProperty("停单备注")
    private String remark;

    public String getLogisticsStatusText() {
        return LogisticsStatusEnum.getDesc(this.logisticsStatus);
    }

//    public String getStockStatusText() {
//        return StockStatusEnum.getDesc(this.stockStatus);
//    }

    public Integer getCompleteDays() {
        return Dates.getDifferentDays(Dates.getTimeNow(), this.getCompleteTime()) - 1;
    }
}
